x86/viridian: add warnings for unimplemented hypercalls and MSRs
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 22 Mar 2017 11:04:20 +0000 (12:04 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 22 Mar 2017 11:04:20 +0000 (12:04 +0100)
commit5047677108c891f25f362487933699ea6eb5c336
tree1147cdf3eef90ca158bbca05f5b3460231673a28
parent791260bab71a1c969b17ff77356a8a5f592fad43
x86/viridian: add warnings for unimplemented hypercalls and MSRs

These warnings can be useful when Microsoft updates Windows.

In the past there have been several cases when Windows erroneously uses
hypercalls and MSRs that should be gated on CPUID flags than Xen does
not set. The usual symptom is a guest crash with little or no information
in the hypervisor log. Adding these warnings at least gives a clue as to
what might be happening in such cases.

Some versions of Windows do currently issue hypercalls that they should
not, so this patch whitelists those to avoid the warnings as the lack
of implementation is clearly proved not to be a problem to the guest.

The warnings are rate limited so a malicious guest cannot use them to
as a DoS.

NOTE: Because the MSR warnings need to be gated on range checking the
      MSR address this patch imports the up-to-date definitions of all
      the viridian MSRs from the specification.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/viridian.c